Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haskellPackages.cabal-plan-bounds: Unbreak, add myself as maintainer #242609

Closed
wants to merge 1 commit into from

Conversation

nomeata
Copy link
Contributor

@nomeata nomeata commented Jul 10, 2023

Description of changes

The package could easily be unbroken by passing a new version of Cabal-syntax.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@sternenseemann
Copy link
Member

#240387 updates the default GHC to 9.4 which uses 3.8 by default. Can you rebase your PR on haskell-updates and try unbreaking it there (seems like there is a new bounds problem).

@nomeata
Copy link
Contributor Author

nomeata commented Jul 10, 2023

seems like there is a new bounds problem

Indeed, not with cabal-plan-bounds, but its dependency cabal-plan. It has an upper bound on base-compat.

I tried to see if jailbreaking helps, but oddly, this doesn’t work:

--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -2168,10 +2168,8 @@ self: super: {
     Cabal-syntax = self.Cabal-syntax_3_10_1_0;
   }));

+  # 2023-07-10: cabal-plan needs newer base-compat
+  cabal-plan = doJailbreak super.cabal-plan;

   large-hashable = lib.pipe (super.large-hashable.override {
     # https://github.com/factisresearch/large-hashable/commit/5ec9d2c7233fc4445303564047c992b693e1155c

I still get

$ nix-build -A haskellPackages.cabal-plan .
…
       > Error: Setup: Encountered missing or private dependencies:
       > base-compat >=0.13.0 && <0.14
       >
       For full logs, run 'nix log /nix/store/gz3rkv8p8j159s0sx78113y59pam6w6n-cabal-plan-0.7.3.0.drv'.

I wonder what I am doing wrong.

@sternenseemann
Copy link
Member

jailbreak-cabal intentionally leaves bounds inside conditionals alone in order not to mess with Cabal's flag solver. I guess base-compat is in a conditonal? In that case you need to patch the cabal file (for now at least, until haskell/cabal#9016 is done).

@nomeata
Copy link
Contributor Author

nomeata commented Jul 10, 2023

Yes, that’s it. Annoying.

@nomeata
Copy link
Contributor Author

nomeata commented Jul 10, 2023

Looks like there is a new revision of cabal-plan on hackage that should fix this.

@sternenseemann
Copy link
Member

You can pick new revision early like this or, of course, wait for the next hackage bump.

overrideCabal (drv: {
  revision = assert drv.revision == "1"; "2";
  editedCabalFile = "sha256-…";
})

@nomeata
Copy link
Contributor Author

nomeata commented Jul 12, 2023

wait for the next hackage bump.

That was my plan :-D

@nomeata
Copy link
Contributor Author

nomeata commented Jul 20, 2023

Just had a look, the latest revision is in, but cabal-plan depends on base-compat-0.13.0. This works great on GHC-9.6, but on GHC-9.4, base-compat is still 0.12, and overriding it gives

Warning:
    This package indirectly depends on multiple versions of the same package. This is very likely to cause a compile failure.
      package topograph (topograph-1.0.0.2-3tHBQRic9TSABtFXcNsl6C) requires base-compat-0.12.3-EzIEO7DrtWn73MXq9N0DKk
      package base-compat-batteries (base-compat-batteries-0.12.3-8cIdD6XdBQgJ5TQIiFvwZ0) requires base-compat-0.12.3-EzIEO7DrtWn73MXq9N0DKk
      package cabal-plan (cabal-plan-0.7.3.0) requires base-compat-0.13.0-Cvz3167VMpo6rdOohSlum3

Not sure what to do about it.

@flokli
Copy link
Contributor

flokli commented Aug 30, 2023

I just noticed haskellPackages.cabal-plan got marked as broken entirely in 72573db (August 16), even though it seemingly is in some hydra jobset (pkgs/top-level/release-haskell.nix).

The build failure linked in the comment (https://hydra.nixos.org/build/230967016) is not what's currently failing it, but the wrong base-compat version:

❯ NIXPKGS_ALLOW_BROKEN=1 nix-build -A haskellPackages.cabal-plan --builders ''
this derivation will be built:
  /nix/store/dyw6zwqgmr02xsdzngm7w9dllzrjd4cs-cabal-plan-0.7.3.0.drv
building '/nix/store/dyw6zwqgmr02xsdzngm7w9dllzrjd4cs-cabal-plan-0.7.3.0.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/kzn0hhns3y7khx6zjsnm9vdgnasc475j-ghc-9.4.6.
unpacking sources
unpacking source archive /nix/store/bf5bixs3fiyviwpskrm3sf5zrkdjjs6q-cabal-plan-0.7.3.0.tar.gz
source root is cabal-plan-0.7.3.0
setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file cabal-plan-0.7.3.0/src-exe/ProcessLazyByteString.hs
patching sources
Replace Cabal file with edited version from mirror://hackage/cabal-plan-0.7.3.0/revision/2.cabal.
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/tmp.MQKZLbYIL1/setup-package.conf.d -j12 +RTS -A64M -RTS -threaded -rtsopts
[1 of 2] Compiling Main             ( Setup.hs, /build/tmp.MQKZLbYIL1/Main.o )
[2 of 2] Linking Setup
updateAutotoolsGnuConfigScriptsPhase
configuring
configureFlags: --verbose --prefix=/nix/store/jj5fji4irdik3y4vjy2j5kd1a2bfcklh-cabal-plan-0.7.3.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/flwzw3piwcwxwyr3fnyzs27s7m9g7abb-cabal-plan-0.7.3.0-doc/share/doc/cabal-plan-0.7.3.0 --with-gcc=gcc --package-db=/build/tmp.MQKZLbYIL1/package.conf.d --ghc-options=-j12 +RTS -A64M -RTS --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --ghc-options=-haddock -fexe --extra-lib-dirs=/nix/store/n31yg2ngxgb1smg553q4kak5ckf9cnb3-ncurses-6.4/lib --extra-lib-dirs=/nix/store/86wfcbx4zg1dmgrfs2d54flvsdadgb0p-libffi-3.4.4/lib --extra-lib-dirs=/nix/store/44bqlp05nq9ymdjvngjx8fdjrfmgj63h-gmp-with-cxx-6.3.0/lib
Using Parsec parser
Configuring cabal-plan-0.7.3.0...
CallStack (from HasCallStack):
  withMetadata, called at libraries/Cabal/Cabal/src/Distribution/Simple/Utils.hs:370:14 in Cabal-3.8.1.0:Distribution.Simple.Utils
Error: Setup: Encountered missing or private dependencies:
base-compat >=0.13.0 && <0.14

error: builder for '/nix/store/dyw6zwqgmr02xsdzngm7w9dllzrjd4cs-cabal-plan-0.7.3.0.drv' failed with exit code 1;
       last 10 log lines:
       > updateAutotoolsGnuConfigScriptsPhase
       > configuring
       > configureFlags: --verbose --prefix=/nix/store/jj5fji4irdik3y4vjy2j5kd1a2bfcklh-cabal-plan-0.7.3.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/flwzw3piwcwxwyr3fnyzs27s7m9g7abb-cabal-plan-0.7.3.0-doc/share/doc/cabal-plan-0.7.3.0 --with-gcc=gcc --package-db=/build/tmp.MQKZLbYIL1/package.conf.d --ghc-options=-j12 +RTS -A64M -RTS --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --ghc-options=-haddock -fexe --extra-lib-dirs=/nix/store/n31yg2ngxgb1smg553q4kak5ckf9cnb3-ncurses-6.4/lib --extra-lib-dirs=/nix/store/86wfcbx4zg1dmgrfs2d54flvsdadgb0p-libffi-3.4.4/lib --extra-lib-dirs=/nix/store/44bqlp05nq9ymdjvngjx8fdjrfmgj63h-gmp-with-cxx-6.3.0/lib
       > Using Parsec parser
       > Configuring cabal-plan-0.7.3.0...
       > CallStack (from HasCallStack):
       >   withMetadata, called at libraries/Cabal/Cabal/src/Distribution/Simple/Utils.hs:370:14 in Cabal-3.8.1.0:Distribution.Simple.Utils
       > Error: Setup: Encountered missing or private dependencies:
       > base-compat >=0.13.0 && <0.14
       >
       For full logs, run 'nix log /nix/store/dyw6zwqgmr02xsdzngm7w9dllzrjd4cs-cabal-plan-0.7.3.0.drv'.

Is there any plan on how to get this fixed? I assume haskellPackages.ghc is gonna stay at 9.4.x for the time being…

@maralorn
Copy link
Member

I just noticed haskellPackages.cabal-plan got marked as broken entirely in 72573db (August 16), even though it seemingly is in some hydra jobset (pkgs/top-level/release-haskell.nix).

That is not very surprising since the package or its codependencies currently have no maintainer.

Is there any plan on how to get this fixed? I assume haskellPackages.ghc is gonna stay at 9.4.x for the time being…

Yes, we will probably stick with 9.4 until at least 23.11.

Since cabal-plan-bounds is a leave package I think an overrideScope might work.
For cabal-plan as a library, this could become a problem. But we could at least get the tool working.

@flokli
Copy link
Contributor

flokli commented Aug 30, 2023

In that specific instance, it's cabal-plan as a CLI tool, not the library.

@sternenseemann
Copy link
Member

I think it is probably easiest and most worthwhile making cabal-plan compatible with Stackage LTS 21 upstream which would help everyone out.

@nomeata
Copy link
Contributor Author

nomeata commented Aug 30, 2023

Using cabal-plan 0.7.2.3 instead of 0.7.3.0 might be lts-compatible

@nomeata
Copy link
Contributor Author

nomeata commented Oct 15, 2023

New attempt at #261261

@nomeata nomeata closed this Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants